/**
 * @author LKQ
 * @date 2022/1/28 10:50
 * @description 超时
 */
public class Solution {
    public static void main(String[] args) {

    }
    public int numberOfWeakCharacters(int[][] properties) {
        int n = properties.length;
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int attack = properties[i][0], defense = properties[i][1];
            for (int j = 0; j < n; j++) {
                if (i == j) {
                    continue;
                }
                int attack1 = properties[j][0], defense1 = properties[j][1];
                if (attack1 > attack && defense1 > defense) {
                    ans++;
                    break;
                }
            }
        }
        return ans;
    }
}
